package com.philip.journal.home.bean;

// Generated 04 6, 10 12:09:03 PM by Hibernate Tools 3.2.2.GA
import com.philip.journal.core.bean.AbstractAuditableBean;

/**
 * Represents a journal entry in Journal Application.
 */
public class Entry extends AbstractAuditableBean {

    /** title Field name. */
    public static final String TITLE = "title";

    /** Entry ID Field name. */
    public static final String ID = "nodeId";

    /** Detail Field name. */
    public static final String DETAIL = "description";

    /** parent Field name. */
    public static final String PARENT = "branch";

    /** Entry Id. */
    private long nodeId;

    /** Title/name of the entry. */
    private String title;

    /** Description. */
    private String description;

    /** Branch where this entry belongs. */
    private Branch branch;

    /** Assistance field for the path of this Entry in the tree. */
    private String treePath;

    /** Default no parameter constructor. */
    public Entry() {
        super();
    }

    /**
     * Convenience parameterized constructor.
     *
     * @param pTitle {@link #title}
     * @param pDescription {@link #description}
     * @param pBranch {@link #branch}
     */
    public Entry(final String pTitle, final String pDescription, final Branch pBranch) {
        this();
        this.title = pTitle;
        this.description = pDescription;
        this.branch = pBranch;
    }

    /**
     * @see #nodeId.
     * @return nodeId.
     */
    public long getNodeId()
    {
        return this.nodeId;
    }

    /**
     * @param pNodeId {@link #nodeId}
     */
    public void setNodeId(final long pNodeId)
    {
        this.nodeId = pNodeId;
    }

    /**
     * @return {@link #title}
     */
    public String getTitle()
    {
        return this.title;
    }

    /**
     * @param pTitle {@link #title}
     */
    public void setTitle(final String pTitle)
    {
        this.title = pTitle;
    }

    /**
     * @return {@link #description}
     */
    public String getDescription()
    {
        return this.description;
    }

    /**
     * @param pDescription {@link #description}
     */
    public void setDescription(final String pDescription)
    {
        this.description = pDescription;
    }

    /**
     * @return {@link #branch}
     */
    public Branch getBranch()
    {
        return this.branch;
    }

    /**
     * @param pBranch {@link #branch}
     */
    public void setBranch(final Branch pBranch)
    {
        this.branch = pBranch;
    }

    @Override
    public String getPrimaryKeyField()
    {
        return Entry.ID;
    }

    /**
     * @param pTreePath new treePath to set.
     */
    public void setTreePath(final String pTreePath)
    {
        this.treePath = pTreePath;
    }

    /**
     * {@link #treePath}.
     *
     * @return Three path for this entry.
     */
    public String getTreePath()
    {
        return treePath;
    }
}
